﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Etapa1.ModelDescription
{
    /// <summary>    
    /// Edge v1,v2 == v2,v1
    /// </summary>
    public class Edge
    {
        bool marked = false;

        public bool Marked
        {
            get { return marked; }
            set { marked = value; }
        }

        public Edge(Vertice v0, Vertice v1)
        {
            vertices[0] = v0;
            vertices[1] = v1;         
        }

        public void NotifyVerticesAboutEdge()
        {
            vertices[0].addEdge(this);
            vertices[1].addEdge(this);
        }

        int positionInEdgeList;

        public int PositionInEdgeList
        {
            get { return positionInEdgeList; }
            set { positionInEdgeList = value; }
        }

        Vertice[] vertices = new Vertice[2];
        List<Triangulo> trianguloPertencente = new List<Triangulo>();

        public List<Triangulo> TrianguloPertencente
        {
            get { return trianguloPertencente; }            
        }
        

        public Vertice[] Vertices
        {
            get { return vertices; }            
        }

        public Vertice V0
        {
            get { return vertices[0]; }
        }

        public Vertice V1
        {
            get { return vertices[1]; }
        }

        public bool Contains(Vertice vertice)
        {
            return vertices.Contains(vertice);
        }

        public Vertice Other(Vertice vertice)
        {
            if (vertices[0] == vertice)
                return vertices[1];
            return vertices[0];
        }


    }
}
